package com.xhwy.vo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

//查询订单返回的数据实体
//解析json数据时忽略未知的属性
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class OrderVo implements Comparable<OrderVo>, Serializable {

    private String orderDetailId; //订单编号

    private Integer orderState; //订单状态

    private Timestamp createTime; //订单时间

//    private Timestamp paymentTime; //付款时间

    private Double totalPayment; //总付款

    private List<ProductVo> productVoList; //购物清单


    //自然排序
    @Override
    public int compareTo(OrderVo obj) {
        if(this.createTime.getTime() > obj.createTime.getTime()) return -1;
        return 1;
    }
}

